package com.matt.foundation.constant;

import lombok.Setter;

/**
 * *******************************
 * Created by Ron.
 * form com.matt
 * on 2018/12/26
 * *******************************
 */
public class ContractProductConstant {

    //合同产品类型
    public enum Type{
        PLAN(1,"意向"),
        BUY(2,"已购买");

        @Setter
        private int code;

        @Setter
        private String value;

        Type(int code, String value){
            this.code = code;
            this.value = value;
        }

        public int codeOf(){
            return code;
        }

        public String valueOf(){
            return value;
        }

        public ContractProductConstant.Type get(int code){
            for (ContractProductConstant.Type type : values()) {
                if (type.codeOf()==code)
                    return type;
            }
            return null;
        }
    }


}
